<?php

namespace App\Constant;

class Utils
{
    public static function unique_id($prefix = "", $sufix = "")
    {
        $uniqId = $prefix . strtoupper(date('m') + 10).date('d') . substr(time(), -5) . substr(microtime(), 2, 5) . sprintf('%02d',rand(0, 99)) . $sufix;
        return $uniqId;
    }

    public static function uuid($prefix = "", $sufix = "")
    {
        $charid = strtoupper ( md5 ( uniqid ( rand (), true ) ) );
        $hyphen = chr ( 45 );
        return $prefix.substr ( $charid, 0, 8 ) . $hyphen . substr ( $charid, 8, 4 ) . $hyphen . substr ( $charid, 12, 4 ) . $hyphen . substr ( $charid, 16, 4 ) . $hyphen . substr ( $charid, 20, 12 ).$sufix;
    }
}
